home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / fstwait.com / TEST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-04-08  |  2.0 KB  |  72 lines

  1. uses CRT, FastWait;
  2.  
  3.     VAR
  4. Counter    : word;
  5. jj        : LongInt;
  6.  
  7. begin
  8. clrscr;
  9. HighVideo;
  10. writeln('           Southern Software  (c) 1991'#10);
  11. LowVideo;
  12. writeln('This test compares the standard "delay" routine with our new "Wait"');
  13. writeln('procedure.  Below is the calculated number of small loops the PC goes');
  14. writeln('through for one millisecond delay.  If this number is above 1,191 then');
  15. writeln('the "delay" routine in the Turbo CRT unit as well as those in the');
  16. writeln('TurboPower Software Object Professional and Turbo Professional series');
  17. writeln('will yield delays that are too short.  Our "wait" procedure is the same');
  18. writeln('as the "delay" procedure except that it will adjust for faster machines.');
  19. writeln;
  20. writeln('The looping below is for 10 seconds in each case.  The seconds are shown');
  21. writeln('and at the end, the number of BIOS ticks is shown.  A properly calibrated');
  22. writeln('delay routine should be almost exactly 10 seconds long, which is 182 ticks.');
  23. writeln;
  24. writeln('To abort at any time, press any key.');
  25. writeln(#10);
  26. write('The delay factor for this machine is actually ');
  27. HighVideo;
  28. writeln(WaitOneMS);
  29. LowVideo;
  30. writeln(#10);
  31. writeln('10 second delays using');
  32. write('    CRT unit "delay" : ');
  33. HighVideo;
  34.  
  35. {delay 10 seconds using the CRT unit "delay" routine}
  36. jj:=BIOSTick;
  37. repeat until jj<>BIOSTick;
  38. jj:=BIOSTick;
  39. for Counter := 1 to 10 do begin
  40.     delay(1000);
  41.     write(Counter);
  42.     end;
  43. jj:=BIOSTick-jj;
  44. LowVideo;
  45. write('         BIOS Ticks : ');
  46. HighVideo;
  47. writeln(jj);
  48.  
  49. LowVideo;
  50. write('FastWait unit "wait" : ');
  51. HighVideo;
  52. {delay 10 seconds using the FastWait unit "wait" routine}
  53. jj:=BIOSTick;
  54. repeat until jj<>BIOSTick;
  55. jj:=BIOSTick;
  56. for Counter := 1 to 10 do begin
  57.     wait(1000);
  58.     write(Counter);
  59.     end;
  60. jj:=BIOSTick-jj;
  61. LowVideo;
  62. write('         BIOS Ticks : ');
  63. HighVideo;
  64. writeln(jj,#10);
  65.  
  66. LowVideo;
  67. write('Press any key to end ');
  68. repeat until keypressed;
  69. while keypressed do Counter:=ord(ReadKey);
  70. clrscr;
  71. end.
  72.